alex_empallo
01/31/2025, 10:26 PMalbert_wong
02/01/2025, 1:24 AMalbert_wong
02/01/2025, 1:26 AMreshma
02/01/2025, 6:42 PMalbert_wong
02/02/2025, 10:22 PMalex_empallo
02/03/2025, 4:41 PMrefreshIfExpired method refresh the access token by using the refresh token (which lasts longer)?
- How long does the refresh token last before it expires?
- Does refreshing the access token once every few minutes to ensure the session stays active mean I'm keeping the user logged in for as long as the refresh token lasts?
For context, here's the useEffect I'm using to do this in `src/App.tsx`:
useEffect(() => {
const refreshSession = async () => {
if (medplum) {
console.log('Session refreshed');
await medplum.refreshIfExpired();
}
};
const interval = setInterval(refreshSession, 5 * 60 * 1000); // every 5 minutes
return () => clearInterval(interval);
}, [medplum]);rahul1
02/03/2025, 6:28 PMrahul1
02/03/2025, 7:51 PMalex_empallo
02/04/2025, 5:59 PMGuoyi Z (Empallo)
02/07/2025, 10:26 PMGuoyi Z (Empallo)
02/07/2025, 10:26 PMreshma
02/13/2025, 5:00 PM